<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="java.util.*"%>
<%@page import="java.sql.*"%>

<html>
<head>


<meta content="text/html; charset=UTF8" http-equiv="content-type">
<title>no title</title>
</head>
<body>
<%
	double[] res = new double[4];
	Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
	String connectionUrl = "jdbc:sqlserver://localhost:1438;database=HKBANK;user=sa;password=1111";
	Connection conn = DriverManager.getConnection(connectionUrl);
	Statement stmt = conn
			.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
					ResultSet.CONCUR_UPDATABLE);
	String sql = "select top 1 * from last order by id desc";
	ResultSet rs = stmt.executeQuery(sql);
	while (rs.next()) {
		res[0] = rs.getDouble("cpv");
		res[1] = rs.getDouble("totalfx");
		res[2] = rs.getDouble("total_securities");
		res[3] = rs.getDouble("totalir");

	}
%>

<%
	//out.println(al.size());
	rs.close();
	stmt.close();
	conn.close();
	////src="http://chart.apis.google.com/chart?chxr=0,0,50,1&chxt=y,x&chs=440x220&cht=lxy&chco=FF0000&chd=t:-1|<%for (int i = 0; i < al.size(); i++) {
%>
<table style="text-align: left; width: 600px; table-layout: fixed"
	border="1" cellpadding="2" cellspacing="2">
	<tbody>
		<tr>
			<td style="vertical-align: top;"><span class="Apple-style-span"
				style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span
				class="Apple-style-span"
				style="font-weight: bold; text-align: left; word-break: break-all; width: 300">Name
			</span></span></td>
			<td style="vertical-align: top;"><span class="Apple-style-span"
				style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span
				class="Apple-style-span"
				style="font-weight: bold; text-align: left; word-break: break-all; width: 600">Value<br>
			</span></span></td>
		</tr>
		<tr>
			<td style="vertical-align: top;"><span class="Apple-style-span"
				style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span
				class="Apple-style-span"
				style="font-weight: bold; text-align: left;">Clearing Payment
			Value of the Bank</span></span></td>
			<td style="vertical-align: top;"><%=res[0]%><br>
			</td>
		</tr>
		<tr>
			<td style="vertical-align: top;"><span class="Apple-style-span"
				style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span
				class="Apple-style-span"
				style="font-weight: bold; text-align: left;">FX Exposure</span></span></td>
			<td style="vertical-align: top;"><%=res[1]%><br>
			</td>
		</tr>
		<tr>
			<td style="vertical-align: top;"><span class="Apple-style-span"
				style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span
				class="Apple-style-span"
				style="font-weight: bold; text-align: left;">Stock Exposure</span></span></td>
			<td style="vertical-align: top;"><%=res[2]%><br>
			</td>
		</tr>
		<tr>
			<td style="vertical-align: top;"><span class="Apple-style-span"
				style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span
				class="Apple-style-span"
				style="font-weight: bold; text-align: left;">Interest Rate
			Exposure</span></span></td>
			<td style="vertical-align: top;"><%=res[3]%><br>
			</td>
		</tr>

	</tbody>
</table>

<br>

</body>
</html>